package com.molan.molan_music.controller;

import com.molan.molan_music.dto.TokenCreateRequest;
import com.molan.molan_music.service.UserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;


@Api(tags = "token接口")
@RestController
@RequestMapping("/token")
public class TokenController {

    @Resource
    private UserService userService;

    @ApiOperation(value = "获取token",notes = "获取token")
    @PostMapping("/tokenCreate")
    public String tokenCreate(@RequestBody TokenCreateRequest tokenCreateRequest){
        return userService.tokenCreate(tokenCreateRequest);
    }
}
